Creates a Interaction object, which may then be used to be added to the Interactions list.
Parent Type: LearningDataModel
Namespace: Microsoft.LearningComponents.DataModel
Assembly: Microsoft.LearningComponents.dll
| C# |
|
public Interaction CreateInteraction () |
A new Interaction object associated with this LearningDataModel.
| Exception type | Condition |
| InvalidOperationException | Thrown if this LearningDataModel object cannot be written to. |
The following example demonstrates creating a new interaction and adding it to the Interactions collection.
| C# |
LearningSession session = ... ; // get LearningSession object Interaction i = session.CurrentActivityDataModel.CreateInteraction(); i.Id = "interaction1"; // A unique identifier is required before this is added to the list i.InteractionType = InteractionType.TrueFalse; session.CurrentActivityDataModel.Interactions.Add(i); |